|
The nm command ships with a number of later versions of Unix and similar operating systems. nm is used to examine binary files (including libraries, compiled object modules, shared-object files, and standalone executables) and to display the contents of those files, or meta information stored in them, specifically the symbol table. The output from nm distinguishes between various symbol types. For example, it differentiates between a function that is supplied by an object module and a function that is required by it. nm is used as an aid for debugging, to help resolve problems arising from name conflicts and C++ name mangling, and to validate other parts of the toolchain. The GNU Project ships an implementation of nm as part of the GNU Binutils package. ==nm output sample== If the previous code is compiled with the gcc C compiler, the output of the nm command is the following: # nm test.o When the C++ compiler is used, the output differs:
The differences between the outputs also show an example of solving the name mangling problem by using extern "C" in C++ code. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Nm (Unix)」の詳細全文を読む スポンサード リンク
|